/**
 * overload.java
 * Assignment #2 Seminar 4
 *
 * Analyze the code presented in the overload program.
 *
 * Find the methods that are overloaded and explain in detail how
 * and why they are overloaded.
 *
 * Next, overload any method in the code that is not yet overloaded.
 * 
 * @author John Thomason
 *   Date: Fall 2008
 * Course: CS222 Java II
 */
class overload // access modifier "public" optional; defaults to public
{
 public static void main(String[] jim)
   {
    int inum  = 5,
        inum1 = 6,
        inum2 = 7,
        max1;
    double dnum = 2.5;

    IsitTrue(inum,inum1);
    Getstwo(inum,dnum); //actual parameters

    dnum = Getstwo1(inum,dnum);

    System.out.println("dnum is now " + dnum);
    max1 = Math.max(inum,inum1);

    System.out.println("The Max is: " + max1);
    System.out.println("The Power is: " + Math.pow(inum,inum1));

    IsitFalse(inum,inum1);
    IsitFalse(inum,inum1,inum2); //Overloaded Method

    IsitTrue(inum,inum1);
    IsitTrue(inum,inum1,inum2);  //Overloaded Method

    Getstwo(inum1,dnum);
    Getstwo(inum,inum1);         //Overloaded Method

    System.out.println("Getstwo1 Results: " + Getstwo1(inum1,dnum));
    //Overloaded Method
    System.out.println("Getstwo1 Results: " + Getstwo1(inum,inum1)); 

   }//main()

  /**
   * IsitTrue(int,int)
   * Original Method. This method was not overloaded, because there was not
   * another method with the same name and different signature.
   *
   * This method test if the First number is greater than the second number.
   * Then displays the appropriate results.
   *
   * @param inum
   * @param inum1
   */
  public static void IsitTrue(int inum, int inum1)
   {
     boolean isitTrue = (inum > inum1);
     System.out.println("The variable isitTrue is " + isitTrue);
   }

  /**
   * IsitTrue(int,int,int)
   * My overloaded method.
   * 
   * This method tests if the First number is less than the Second number.
   * Then displays the appropriate results. The Third number is never used.
   *
   * @param inum  First number
   * @param inum1 Second number
   * @param inum2 Third number
   */
  public static void IsitTrue(int inum, int inum1, int inum2)
   {
     boolean isitTrue = (inum < inum1);
     System.out.println("The variable isitTrue is " + isitTrue);
   }

  /**
   * Getstwo(int,double)
   * Original method. This method was not overloaded, because there was not
   * another method with the same name and different signature.
   *
   * This method multiplies the First number by the Second number, and
   * displays the appropriate results.
   *
   * @param inum1 First number
   * @param dnum1 Second number
   */
  public static void Getstwo(int inum1, double dnum1)
   {
     double newnum;
     newnum = inum1 * dnum1;
     System.out.println("newnum is " + newnum);
   }

  /**
   * Getstwo(int,int)
   * My overloaded method.
   * 
   * This method multiplies the Frist number by the Second number,
   * and displays the appropriate results.
   * 
   * @param inum1 First number
   * @param inum2 Second number
   */
  public static void Getstwo(int inum1, int inum2)
   {
     int newnum;
     newnum = inum1 * inum2;
     System.out.println("newnum is " + newnum);
   }

  /**
   * Getstwo1(int,double)
   * Original method. This method was not overloaded, because there was not
   * another method with the same name and different signature.
   *
   * This method multiplies the First number by the Second number, and
   * then by two(2), then it returns the results as a double
   *
   * @param inum1 First number
   * @param dnum1 Second number
   * @return      The multiplication results
   */
  public static double Getstwo1(int inum1, double dnum1)
   {
     dnum1 = inum1 * dnum1 * 2;
     return dnum1;
   }

  /**
   * Getstwo1(int,int)
   * My overloaded method.
   *
   * This method multiplies the First number by the Second number, and
   * then by two(2), then it returns the results as a double
   *
   * @param inum1 First number
   * @param inum2 Second number
   * @return      The multiplication results
   */
  public static int Getstwo1(int inum1, int inum2)
   {
     inum2 = inum1 * inum2 * 2;
     return inum2;
   }

  /**
   * IsitFalse(int,int)
   * Overloaded method. This method is overloaded, because it has the same
   * name as the following method, yet has a different signature.
   * 
   * This method tests if the First number is less than the Second number.
   * Then it displays the appropriate results.
   *
   * @param inum  First number
   * @param inum1 Second number
   */
  public static void IsitFalse(int inum, int inum1)
   {
     boolean isitFalse = (inum < inum1);
     System.out.println("The variable isitFalse is " + isitFalse);
   }

  /**
   * IsitFalse(int,int,int)
   * Overloaded Method.. This method is overloaded, because it has the same
   * name as the previous method, yet has a different signature.
   *
   * This method tests if the First number is greater than the Second number.
   * Then it displays the appropriate results. The Third number is never used.
   *
   * @param inum  First number
   * @param inum1 Second number
   * @param inum2 Third number
   */
  public static void IsitFalse(int inum, int inum1, int inum2)
   {
     boolean isitFalse = (inum > inum2);
     System.out.println("The variable isitFalse is " + isitFalse);
   }

}//overload class
